import React, { Component, PureComponent } from 'react'

class SomeComponent extends PureComponent {
  render () {
    console.log('子组件刷新了')
    return (
      <div>SomeComponent</div>
    )
  }
}
// const fontSizeStyle = { fontSize: 16 }
// const fn = () => {
//   console.log('do something')
// }
export default class App extends Component {
  state = { count: 10 }
  fontSizeStyle = { fontSize: 16 }

  add = () => {
    this.setState({
      count: this.state.count + 10
    })
  }
  fn = () => {
    console.log('do something')
  }
  render() {
    return (
      <div>
        <button onClick = { this.add }>加</button>
        <SomeComponent style = { this.fontSizeStyle } doSomething = { this.fn } />
      </div>
    )
  }
}
